package com.zby.controller.file;

import com.zby.common.utils.ResultUtil;
import com.zby.service.imp.UploadFileServiceImp;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;


/**
 * @author wuyanzhu
 */
@RestController
@Tag(name = "文件管理")
@RequestMapping(value ="/upload")
public class UploadFileController {
    @Autowired
    private UploadFileServiceImp uploadFileServiceImp;
    @PostMapping(value = "/uploadFileImg")
    @Operation(summary = "上传图片")
    private ResultUtil<String> uploadFileImg(@RequestParam(value ="file")MultipartFile file) throws Exception {
      String url =  uploadFileServiceImp.uploadFileImg(file);
        return ResultUtil.success(url);
    }
    }

